export default function createFileImage(fileIdFieldName, fileFieldName, label, maxSize, accept, params){
    return {
        type: 'service',
        api: {
            url: '/base/file/get?id=${'+ fileIdFieldName +'}',
            responseData: {
                [fileFieldName]:{
                    value: '${url}',
                    url: '${url}',
                    name: '${filename}',
                    fileId: '${fileId}'
                }
            },
            sendOn: '${'+ fileIdFieldName +'}',
        },
        body: {
            type: 'input-image',
            name: fileFieldName,
            label: label,
            maxSize: maxSize,
            accept: accept || '.jpg,.png,.jpeg,.bmp,.gif',
            receiver: '/base/file/upload?preview=1',
            joinValues: false,
            ...params
        }
    }
}